class ApplicationController < ActionController::Base
  protect_from_forgery
  helper_method :current_user
  
  def current_user
    @current_user ||= Usuario.find(session[:usuario_id]) if session[:usuario_id]
  end
  
  private
  def get_user_options
  	if @current_user.type == 'Admin'
  		@user_options = [['Usuarios', 'a'] ]
  	end
  end

  private
  def autoriza_admin
    if current_user.type == "Hospede"
      redirect_to root_url, :notice => "Voce nao tem autorizacao para realizar essa operacao"
    end
  end
end
